package com.titanrise.crm.common.utils;

import java.util.function.Supplier;

public final class Nothing {

    public static final Nothing value = new Nothing();

    private Nothing() {
    }

    @Override
    public String toString() {
        return "Nothing";
    }

    @Override
    public boolean equals(final Object obj) {
        return obj instanceof Nothing;
    }

    public static Supplier<Nothing> ofRunnable(final Runnable runnable) {
        return () -> {
            runnable.run();
            return Nothing.value;
        };
    }
}
